import React, {Component} from 'react';
import {StyleSheet, Text, View, Image, ScrollView} from 'react-native';
import {Button, WhiteSpace, WingBlank, Flex, Toast, List, InputItem} from '@ant-design/react-native';
import {getBankMaterialsList} from '~/api/bank';

export default class LoanProcedures extends Component {
    static navigationOptions = {
        title: '贷款手续',
    };
    constructor() {
        //调用基类的所有的初始化方法
        super();

        // 设置当前组件的属性
        this.state = {
            list: [],
        };
        getBankMaterialsList().then((r) => {
            if (r.code === 0) {
                this.setState({
                    list: r.data,
                });
            } else {
                Toast.info(r.msg, 1);
            }
        });
    }
    render() {
        return (
            <View style={{width: '100%', height: '100%', backgroundColor: 'white'}}>
                <View>
                    <View
                        style={{
                            width: '100%',
                            height: 60,
                            backgroundColor: '#F8F8FC',
                            justifyContent: 'center',
                            flexDirection: 'column',
                            paddingLeft: 16,
                        }}>
                        <Text style={{fontSize: 14, color: '#A3A3A3'}}>个人基础信息</Text>
                    </View>
                    <WhiteSpace size={'xs'} />
                    {this.state.list.map((item) => {
                        return (
                            <>
                                <View style={styles.userviews}>
                                    <Text style={styles.userText}>必传文件</Text>
                                    <View style={styles.nameinputstyle}>
                                        <List>
                                            <InputItem editable={false} value={item.MaterialName} />
                                        </List>
                                    </View>
                                </View>
                                <WhiteSpace size={'xs'} />
                            </>
                        );
                    })}
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    userText: {
        width: 100,
        height: 50,
        textAlign: 'center',
        textAlignVertical: 'center',
        fontSize: 15,
    },
    userviews: {
        flexDirection: 'row',
        backgroundColor: '#FFFFFF',
        height: 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    nameinputstyle: {
        width: '65%',
        textAlign: 'center',
        flexDirection: 'column',
        justifyContent: 'center',
    },
});
